package server.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import server.business.pojo.State;
import server.business.service.StateService;
import server.business.utils.Result;

import java.util.List;

@Controller
@RequestMapping("/state")
public class StateController {
    @Autowired
    private StateService stateService;

    /**
     * 查询血液状态
     */
    @RequestMapping("/normal/queryBloodInformationState")
    @ResponseBody
    public Result queryBloodInformationState() {
        stateService.list();
        Result result = new Result();
        result.setData(stateService.list());
        return result;
    }


    @RequestMapping("/normal/query")
    @ResponseBody
    public List<State> queryData(){
        List<State> list = stateService.queryData();
        return list;
    }

    @GetMapping( "/normal/getName")
    @ResponseBody
    public server.business.utils.results.lrz.Result getName() {
        List<State> stateList = stateService.list();
        return server.business.utils.results.lrz.Result.success(stateList);
    }


}
